package com.zs.taskmanager.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.zs.taskmanager.entity.Task;
import com.zs.taskmanager.service.ITaskService;

@RestController
@RequestMapping("/task")
public class TaskController {
	@Resource
	private ITaskService taskService;
	@RequestMapping("/save")
	public String save(String taskName,String doTime) {
		String user = "admin";
		return taskService.save(taskName,doTime,user);
	}
	@RequestMapping("/delete")
	public String delete(String id) {
		String user = "admin";
		return taskService.delete(id,user);
	}
	@RequestMapping("/list")
	public List<Task> list() {
		return taskService.findAll();
	}
}
